package com.superme.common.exceptions;

import com.superme.common.enums.ExceptionCodeEnum;
import lombok.Getter;
import lombok.Setter;


@Setter
@Getter
public class BusinessException extends RuntimeException {
    private Integer code;
    private String msg;

    public BusinessException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = ExceptionCodeEnum.AUTHENTICATION_FAILED.getCode();
        this.msg = msg;
    }
    public BusinessException(ExceptionCodeEnum exceptionCodeEnum) {
        this.code = exceptionCodeEnum.getCode();
        this.msg = exceptionCodeEnum.getMessage();
    }
}
